Conversation
adambalogh
left a comment
There was a problem hiding this comment.
Review
🔴 Issues to Fix
1. Version mismatch between pyproject.toml and requirements.txt
pyproject.tomlhasog-test-v2-x402==0.0.5requirements.txthasog-test-v2-x402==0.0.6
Pick one (probably 0.0.6 if that's latest).
2. README references wrong filename
- Docs say
approve_permit2.pybut the file isx402_permit2.py
3. Missing trailing newline in requirements.txt
🟡 Suggestions
4. Code duplication in llm.py
make_request() and make_request_v2() share ~80% of their logic. Consider extracting common payload building and response parsing.
5. Hardcoded chain ID
"eip155:84532" appears 4 times — extract to a constant like BASE_SEPOLIA_CHAIN_ID.
6. Private attribute access
client.alpha._wallet_account.address in examples is brittle. Consider exposing a public property.
7. Missing type hint
_parse_sse_response should have -> AsyncGenerator[StreamChunk, None] return type.
✅ What's Good
- Clean network routing separation
- Permit2 check fails early with clear error message
- CLI changes are backwards compatible (defaults to og-evm)
- Proper async/streaming support for both networks
Overall: functional, but fix the version mismatch and README filename before merging.
examples/run_x402_llm_stream.py
Outdated
| private_key=os.environ.get("OG_PRIVATE_KEY"), | ||
| ) | ||
|
|
||
| check_permit2_approval(client.alpha._wallet_account.address, network) |
There was a problem hiding this comment.
i don't think this field exists on client.alpha
add support for llm inference payments on base sepolia